# if __name__ == '__main__':
#     num = 1
#     total = 0
#     while num <= 100:
#         total = total + num
#         # print(total)
#         num += 1
#     print("sum =", total)

# 输入一个正整数,求出能被3整除的 还有包含3的 所有数之和
# if __name__ == '__main__':
#     num = int(input("输入整数:"))
#     sum = 0
#     i = 1
#     while i <= num:
#         if i % 3 == 0:
#             sum += i
#         elif '3' in str(i):
#             sum += i
#         i += 1
#     print("sum = ", sum)


"""
continue: 跳出本次循环
break: 跳出整个循环
"""

# for循环  重点range函数
# if __name__ == '__main__':
#     sum = 0
#     # range(起始值,结束值,步长)  如果起始值是1可以省略  步长是1亦可以省略
#     for i in range(1, 20, 1):
#         sum += i
#     print("sum =", sum)
#
#     total = 0
#     for j in range(10):
#         total += 1
#     print("total =", total)


# range函数
# 需求: 求三位数中58的最大倍数
# if __name__ == '__main__':
#     sum = 0
#     for i in range(999, 100, -1):
#         if i % 58 == 0:
#             print("三位数中58的最大倍数是:", i)
#             break

# 需求: 输入一个数字,判断是不是质数
# 质数又叫素数
# 质数只能被1和自身整除
# if __name__ == '__main__':
#     num = int(input("输入:"))
#     chushu = 2
#     while chushu < num:
#         if num % chushu == 0:
#             print("可以被%d整除不是质数" % chushu)
#             break
#         else:
#             chushu += 1
#     print("%d是质数" % num)


import math


def is_prime_number(num: int):
    # 上面的需求 利用平方根
    for i in range(2, int(math.sqrt(num) + 1)):
        if num % i == 0:
            return False
    return True
